Interface PacketTracerSession

All Known Implementing Classes:
MUSessionImpl, PacketTracerSessionImpl

public interface PacketTracerSession
Author:
packettracerexapps@external.cisco.com
  • Method Details

    • isShutdown

      boolean isShutdown()
    • getEventManager

      IPCEventManager getEventManager()
      Returns:
      IPCEventManager the session's event manager
    • connection

      Returns:
      PacketTracerConnection the underlying PT connection
    • pipeline

      Pipeline pipeline()
      Returns:
      Pipeline the data pipeline and associated filters
    • timer

      Timer timer()
      Returns:
      Timer the keepalive timer
    • isConnected

      boolean isConnected()
      A convenience method to test if the underlying connection is connected
      Returns:
      boolean is pt connected
    • close

      void close() throws IOException
      Terminate this session; close connection and release resources
      Throws:
      IOException - problem with connection
    • write

      void write(LTV tlv) throws IOException
      Passes off the tlv to the pipeline and does not wait for a response
      Parameters:
      tlv - - the tlv to write
      Throws:
      IOException - problem with connection
    • writeRead

      LTV writeRead(LTV tlv) throws IOException
      Passes off the tlv to the pipeline and waits for a response
      Parameters:
      tlv - - the tlv to write
      Returns:
      the tlv returned from PT
      Throws:
      IOException - problem with connection
    • handleEvent

      void handleEvent(LTV event)
      Handles an IPC event that was read off the pipeline
      Parameters:
      event - The event LTV
    • handleMuMessage

      void handleMuMessage(LTV msg)
      Handles Multiuser messages
      Parameters:
      msg - The mu message
    • readWorkerError

      boolean readWorkerError(Throwable t)
      Error handler for Packet Tracer Read Worker thread. Thrown when too many errors accumulate
      Parameters:
      t - The thrown object.
      Returns:
      boolean whether it was properly handled
    • getKeepAliveTask

      KeepAliveTask getKeepAliveTask()
      Returns the keepalive task handler.
      Returns:
      KeepAliveTask The keepalive task handler.
    • handleKeepAlive

      void handleKeepAlive(LTV msg)
      Handler for receiving KeepAliveLTVs. Refreshes the counter.
      Parameters:
      msg - LTV
    • handleLTV

      void handleLTV(LTV msg)
      Passes non return value LTVs to the LTVNotifier if it exists.
      Parameters:
      msg - The KeepAliveLTV object.
    • setNotifier

      void setNotifier(LTVNotifier n)
      Registers your LTVNotifier object with this session.
      Parameters:
      n - The LTVNotifier object.
    • getNotifier

      LTVNotifier getNotifier()
      Returns the notifier object if any.
      Returns:
      LTVNotifier the registered notifier object
    • isIpcReady

      boolean isIpcReady()
      This function will return getSessionStatus() == STATUS_IPC_READY.
      Returns:
      boolean Boolean value of whether the IPC is ready to accept messages.
    • isMuReady

      boolean isMuReady()
      This function will return getSessionStatus() == STATUS_MU_READY.
      Returns:
      boolean Boolean value of whether the Multiuser connection is ready to accept messages.
    • getSessionStatus

      Object getSessionStatus()
      This function returns the status of the session.
      Returns:
      Object The session status object.
    • handleTimeout

      void handleTimeout()
      Notifies the keepalive notifier object of a timeout
    • setTimeoutNotifier

      void setTimeoutNotifier(KeepAliveExpireNotifier n)
      Registers your KeepAliveExpireNotifier object with this session.
      Parameters:
      n - The KeepAliveExpireNotifier object.
    • getTimeoutNotifier

      KeepAliveExpireNotifier getTimeoutNotifier()
      Returns the notifier object if any.
      Returns:
      KeepAliveExpireNotifier the registered notifier object